export class Utils{    
    makeEP (text:string){
        // let str:string = text.toString();
        // if (typeof(text) == "string"){
        //     str = text;
        // }else if (typeof(text) == "number"){
        //      str = text.toString();
        // }
        let e = document.createElement("p");
        let node = document.createTextNode(text);
        e.appendChild(node);
        return e;
    };
    now(): string{
        let date = new Date();
        return date.toLocaleDateString() + " " + date.toLocaleTimeString();
    }
    log(text:any,prefix:string = ""): void{
        console.log(this.now(),prefix,":",text);        
        if (typeof window !== 'undefined'){
            let nText = prefix + ":" + text.toString();
            document.body.appendChild(this.makeEP(nText));
        }
    }

    debug(first:any,...end:any[]): void{
         console.log(this.now(),first.toString(),":",end.join(","));    
    }
}

